package com.situ.mall.admin.controller;

import com.situ.mall.admin.entity.Type;
import com.situ.mall.admin.service.ITypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author yangkx
 * @create 2023-09-09-9:39
 */
@Controller
@RequestMapping("/type")
public class TypeController{

    @Autowired
    private ITypeService typeService;

    //发请求去查分类数据
    @GetMapping("/all")
    @ResponseBody
    public List<Type> all(){
        return typeService.all();
    }

}
